Skip to content

fix: add documented events to menu-button #219 - #232

Merged
ianmcburnie merged 2 commits into
masterfrom
219-menu-button-events
Mar 23, 2026
Merged

fix: add documented events to menu-button #219#232
ianmcburnie merged 2 commits into
masterfrom
219-menu-button-events

Conversation

@ianmcburnie

Copy link
Copy Markdown
Member

Fixes #219

@ianmcburnie
ianmcburnie requested a review from Copilot February 8, 2026 02:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documented menu-button-level events for select/change, aligning event listeners with the menu-button widget rather than the underlying menu element.

Changes:

  • Adds a dedicated handler for "makeup-menu-change" and dispatches "makeup-menu-button-change".
  • Dispatches "makeup-menu-button-select" on select and refactors collapse/focus logic into a shared helper.
  • Updates docs example to listen on widget.el for the documented menu-button events.

Reviewed changes

Copilot reviewed 2 out of 6 changed files in this pull request and generated 2 comments.

File Description
packages/ui/makeup-menu-button/src/index.js Splits change vs select handling, dispatches documented menu-button events, and centralizes collapse behavior.
docs/ui/makeup-menu-button/index.js Updates example listeners to the new menu-button event targets/types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ui/makeup-menu-button/src/index.js Outdated
Comment thread packages/ui/makeup-menu-button/src/index.js
@saiponnada

saiponnada commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

At first, I wondered why the menu collapses on change. Looking closer, makeup-menu-change handles menuitemradio and menuitemcheckbox, while makeup-menu-select handles regular menuitem. The naming(makeup-menu-change) is ambiguous and misleading. A traditional change event fires when a user changes an option in a select, which adds to the confusion.

@ianmcburnie

Copy link
Copy Markdown
Member Author

The naming(makeup-menu-change) is ambiguous and misleading. A traditional change event fires when a user changes an option in a select, which adds to the confusion.

Yes, change is traditionally associated with being fired on when an element changes and loses focus, which isn't true here (in the base menu case) - here the change is fired immediately. I'm not sure what else to call it. Any ideas?

@ianmcburnie

Copy link
Copy Markdown
Member Author

@saiponnada I'm just going to move forward with these as named, to be consistent with the docs and to not introduce breaking changes. I do agree though that change might not be the best event name. We can revisit in future.

@ianmcburnie
ianmcburnie merged commit 4a59bb0 into master Mar 23, 2026
1 check failed
@ianmcburnie
ianmcburnie deleted the 219-menu-button-events branch June 29, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

makeup-menu-button: Docs mention non-existent custom events

3 participants